home *** CD-ROM | disk | FTP | other *** search
- Path: inferno.mpx.com.au!news
- From: Malcolm Smith <mjsmith@mpx.com.au>
- Newsgroups: comp.lang.c++
- Subject: Re: help with conversion subroutine
- Date: 17 Feb 1996 14:04:13 GMT
- Organization: Microplex Pty Ltd
- Message-ID: <4g4n8t$bsg@inferno.mpx.com.au>
- References: <4ffsgm$mkl@mozo.cc.purdue.edu>
- NNTP-Posting-Host: dialup-261.mpx.com.au
-
- Mark Kelsey <kelsey> wrote:
- >
- > I have an assignment that requires me to convert any number (base 2 to 16) to a
- > number in a different base (again 2 to 16). I like to program but math is
- > deffinately a weak area. If anyone can help, please post or mail to
- > kelsey@elmail.purdue.edu
- >
- > Thanks
- > Kelse
- >
- log b
- c
- The conversion is log b = ------
- a log a
- c
-
- This converts log b (base a) to an equivalent in base 10.
-
- eg., log 8 = 3 because 2^3 = 8.
- 2
-
- Let's change to base 10
-
- log 8
- 10
- log 8 = ------
- 2 log 2
- 10
-
-
-